import ajax from '../utils/axios'

export async function getShopCart(id, keywords) {
  const res = await ajax.get(
    `/api/shopcart/queryShopcartByUserId?userId=${id}&keyword=${keywords}`
  )
  return res.data.data
}

export async function clearShopCart(id) {
  const res = await ajax.get(`/api/shopcart/clearShopcart?userId=${id}`)
  return res.data.data
}

export async function createShopCart(params) {
  const res = await ajax.post(`/api/shopcart/create`, params)
  return res.data.data
}

export async function deleteShopCart(ids) {
  const res = await ajax.post(`/api/shopcart/delete?ids=${ids}`)
  return res.data.data
}
